import request from '@/utils/request'

//获取版块列表
export const getCategoriesService = () => {
    return request.get('/admin/category')
}

//添加版块
export const addCategoryService = (category) => {
    return request.post('/admin/category/add', category)
}

//更新版块
export const updateCategoryService = (category) => {
    return request.put('/admin/category/update', category)
}

//删除版块
export const deleteCategoryService = (id) => {
    return request.delete('/admin/category/delete', { params: { id } })
}

//更新版块状态
export const updateCategoryStatusService = (id, status) => {
    return request.patch('/admin/category/status', null, { params: { id, status } })
}